//package com.he.hsdyc.dao;
//
//import com.he.hsdyc.model.User2;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Modifying;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//import org.springframework.stereotype.Repository;
//
//import java.util.List;
//
///**
// * @Author :
// * @Description :
// * @Date : Created in 14:14 2017/10/11
// * @Modified By : NONE
// */
//@Repository
//public interface UserRepository extends JpaSpecificationExecutor<User2>, PagingAndSortingRepository<User2, String> {
//
//
//    @Query(value = "update admin_user set state = 3 WHERE  id = ?1 ",nativeQuery = true)
//    @Modifying
//    void deleteUser(String userId);
//
//    @Query(value = "select u from User2 u where u.state <>3")
//    List<User2> queryAll();
//
//    User2 findByUserName(String name);
//
//
//    @Query(value = "SELECT id,allow_delete,gender,mobile,user_password,real_name,state,user_name FROM admin_user " +
//            "WHERE state <> 3 AND allow_delete = 'Y' AND mobile = ?1 ORDER BY user_name DESC LIMIT 0,5",nativeQuery = true)
//    List<User2> search(String mobile);
//
//    User2 findByMobile(String mobile);
//
//   /* @Query(value = "SELECT\n" +
//            "\tid,\n" +
//            "\tallow_delete,\n" +
//            "\tgender,\n" +
//            "\tmobile,\n" +
//            "\tuser_password,\n" +
//            "\treal_name,\n" +
//            "\tstate,\n" +
//            "\tuser_name\n" +
//            "FROM\n" +
//            "\tadmin_user\n" +
//            "WHERE\n" +
//            "\tstate <> 3\n" +
//            "AND allow_delete = 'Y'\n" +
//            "AND (mobile = ?1)\n" +
//            "ORDER BY\n" +
//            "\tuser_name DESC\n" +
//            "LIMIT 0,5",nativeQuery = true)
//    List<User2> search(String mobile);*/
//}
